import request from "@/api/request";

//创建英雄
export const creatHeros = (value: any) => {
    return request({
        method: "post",
        url: "rest/hero",
        data: value,
    });
};



//获取英雄列表数据
export const getHeros = () => {
    return request({
        method: "get",
        url: "rest/hero",
    });
};


//获取被编辑英雄的详情
export const getEditHeros = (id:string[] | string) => {

    return request({
        method:'get',
        url:`rest/hero/${id}`
    })
}

//更新英雄数据
export const upDateHeros = (id:string | string[],data:any) => {
    return request({
        method:'put',
        url:`rest/hero/${id}`,
        data:data,
    })
}

//删除英雄
export const deletHeros = (id:string | string[]) => {
    return request({
        method:'delete',
        url:`rest/hero/${id}`
    })
}